for n in range(2,4):
    for x in range(2, n):
        if n % x == 0:
            print(n, 'equals', x, '*', n//x)
            break
    else:
        # loop fell through without finding a factor
        print(n, 'is 质数')



# range(start, stop) 生成从 start 到 stop-1 的整数
#
# 当 start >= stop 时，range() 返回空序列
#
# 所以 range(2, 2)、range(5, 3) 等都是空范围
# for...else结构的else子句只有在for循环正常结束（即没有被break语句中断）时才会执
# for n in range(2,4):
#   for j in range(2, n):
#       print('执行')
#       break
#   else:
#       print('不执行')
#
# print('------------------------')
# for n in range(2,4):
#   for j in range(2, n):
#       print('执行')
#   else:
#       print('不执行')

